package com.cskaoyan.converter;

import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

@Component
public class StringArrays2IntArraysConverter implements Converter<String[], int[]> {
    @Override
    public int[] convert(String[] source) {
        int[] ints = new int[source.length];
        int i = 0;
        for (String s : source) {
            ints[i++] = Integer.valueOf(s);
        }
        return ints;
    }
}
